package com.ticket.sass.admin.dto.output.film;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.ticket.sass.admin.dto.output.pricecheme.PriceSchemeSimpOutput;
import com.ticket.sass.admin.util.EscapeUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;

/**
 * @author ywb
 * @date 2022-07-15 17:37
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("排期信息")
public class FilmScheduleListOutput {
    @ApiModelProperty(value = "ID")
    private Long id;
    
    @ApiModelProperty(value = "系统商排期 id")
    private String scheduleKey;
    
    @ApiModelProperty(value = "影厅")
    private String hall;
    
    @ApiModelProperty(value = "影厅")
    private Long hallId;
    
    @ApiModelProperty(value = "影片名")
    private String filmName;
    
    @ApiModelProperty(value = "语言")
    private String lang;
    
    @ApiModelProperty(value = "放映版本")
    private String version;
    
    @JsonIgnore
    @ApiModelProperty(value = "放映时间")
    private LocalDateTime startTime;
    
    @JsonIgnore
    @ApiModelProperty(value = "结束时间")
    private LocalDateTime endTime;
    
    @ApiModelProperty(value = "影厅编码")
    private String hallCode;
    
    @ApiModelProperty(value = "影片编码")
    private String filmCode;
    
    @ApiModelProperty(value = "影厅")
    private Long filmId;
    
    @ApiModelProperty(value = "场次编码（专资编码）")
    private String sessionCode;
    
    @ApiModelProperty(value = "最低发行价")
    private BigDecimal lowestPrice;
    
    @ApiModelProperty(value = "标准票价")
    private BigDecimal standardPrice;
    
    @ApiModelProperty(value = "服务费")
    private BigDecimal serviceFee;
    
    @ApiModelProperty(value = "座位图版本号（凤凰云智）")
    private String seatVersion;
    
    @ApiModelProperty(value = "场次最后更新时间（鼎新）")
    private String lastUpdateTime;
    
    @ApiModelProperty(value = "售价（不为空则优先级高于所有票价方案）")
    private BigDecimal salePrice;
    
    @ApiModelProperty(value = "销售渠道类型 0 微信 1 抖音 2 支付宝 ")
    private List<Short> saleChannelType;
    
    @ApiModelProperty(value = "票价方案")
    private PriceSchemeSimpOutput priceSchemes;
    
    @ApiModelProperty("开始时间文本")
    private String startTimeStr;
    
    @ApiModelProperty(value = "结束时间")
    private String endTimeStr;
    
    public String getStartTimeStr() {
        return EscapeUtil.dateTimeStr(startTime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"));
    }
    
    public String getEndTimeStr() {
        return EscapeUtil.dateTimeStr(endTime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"));
    }
}
